package com.example.clock_demo.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.clock_demo.dto.SchedulingMonthlyDTO;
import com.example.clock_demo.entitys.Scheduling;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.LocalDate;
import java.time.YearMonth;
import java.util.List;


/**
 * 排班信息服务接口
 */
public interface SchedulingService extends IService<Scheduling> {
    /**
     * 根据工号和日期范围查询排班信息
     * @param employeeNumber 工号
     * @param startDate 开始日期
     * @param endDate 结束日期
     * @return 该员工在指定日期范围内的排班列表
     */
    List<Scheduling> getSchedulingForEmployeeByDateRange(String employeeNumber, LocalDate startDate, LocalDate endDate);


    /**
     * 导入排班数据
     */
    void importScheduling(MultipartFile file, YearMonth importMonth) throws IOException;


    /**
     * 按月份删除排班数据
     */
    void deleteByMonth(YearMonth month);

    /**
     * 分页查询月度排班信息
     */
    IPage<SchedulingMonthlyDTO> getMonthlySchedulingPage(Long current, Long size,
                                                         String employeeName, String teamName, YearMonth scheduleMonth);

    /**
     * 导出排班表
     */
    void exportMonthlyScheduling(String employeeName, String teamName, YearMonth scheduleMonth, HttpServletResponse response) throws IOException;

    /**
     * 根据员工工号列表和月份批量删除排班数据
     * @param employeeNumbers 员工工号列表
     * @param month 月份
     */
    void deleteByEmployeeNumbersAndMonth(List<String> employeeNumbers, YearMonth month);
}